from fastapi import FastAPI
from starlette.staticfiles import StaticFiles

from app.core.config import settings
from app.api.v1 import auth, users, welcome

app = FastAPI(title=settings.APP_NAME, debug=settings.APP_DEBUG)
# 挂载静态文件
app.mount("/uploads", StaticFiles(directory="uploads"), name="uploads")
app.include_router(auth.router, prefix="/auth", tags=["auth"])
app.include_router(users.router, prefix="/users", tags=["users"])
app.include_router(welcome.router, prefix="/welcome", tags=["welcome"])


@app.get("/")
def root():
    return {"status": "ok", "app": settings.APP_NAME}
